import type { RouteRecordRaw } from 'vue-router'

/**
 * 路由
 */
export const staticRoutes: Array<RouteRecordRaw> = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login/index.vue'),
    meta: {
      hidden: true
    }
  },

  {
    path: '/404',
    name: '404',
    component: () => import('@/views/error/404.vue'),
    meta: {
      hidden: true
    }
  },

  {
    path: '/',
    component: () => import('@/layout/index.vue'),
    redirect: '/home',
    children: [
      {
        path: 'home',
        name: 'Home',
        component: () => import('@/views/home/index.vue'),
        meta: {
          title: '首页',
          icon: 'ele-HomeFilled'
        }
      }
    ]
  },

  // test管理
  {
    name: 'Test',
    path: '/test',
    component: () => import('@/layout/index.vue'),
    redirect: '/test/test1/list',
    meta: {
      title: 'Test管理',
      icon: 'ele-Setting'
    },
    children: [
      {
        name: 'test1',
        path: '/test/test1/list',
        component: () => import('@/views/test/test1/index.vue'),
        meta: { title: 'Test1' }
      }
    ]
  },

  // 表格表单类
  {
    path: '/table',
    name: 'Table',
    component: () => import('@/layout/index.vue'),
    redirect: '/table/tableTabs',
    meta: {
      title: '表格管理'
    },
    children: [
      {
        name: 'tableTbas',
        path: '/table/tableTabs',
        component: () => import('@/views/table/tabsTable/index.vue'),
        meta: { title: `🥰\xa0\xa0\xa0tabs表格` }
      },
      // 进程详情页
      {
        path: '/table/tableTabs/detailed/:id',
        name: 'Progress',
        component: () => import('@/views/table/jszdetails/index.vue'),

        meta: { title: '进行中订单详情', hidden: true }
      },
      // 动态表格+插槽输入框+计算
      {
        path: '/table/tableTabs/com',
        name: 'TableMathMove',
        component: () => import('@/views/table/TableMathMove/index.vue'),
        meta: { title: '🥰\xa0\xa0\xa0动态表格计算', hidden: false }
      },
      // 树形表格
      {
        path: '/table/aa/tree',
        name: 'treeTable',
        component: () => import('@/views/table/useTreeTable/index.vue'),
        meta: { title: '🥰\xa0\xa0\xa0树形表格', hidden: false }
      }
    ]
  },
  // 图标展示
  {
    path: '/dyicon',
    name: 'Dyicon',
    component: () => import('@/layout/index.vue'),
    redirect: '/dyicon/dyiconsele',
    meta: {
      title: '图标管理'
    },
    children: [
      {
        name: 'dyiconsele',
        path: '/dyicon/dyiconsele',
        component: () => import('@/views/dyicon/index.vue'),
        meta: { title: '动态图标', icon: 'ele-ChatLineSquare' }
      }
    ]
  }
]

/* 任意路由 */
export const anyRoute: RouteRecordRaw = {
  path: '/:pathMatch(.*)',
  name: 'Any',
  redirect: '/404',
  meta: {
    hidden: true
  }
}
